package com.yyk.yykywd.mvvm.adapter

import android.content.Context
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yyk.yykywd.R
import com.yyk.yykywd.config.HttpUrl
import com.yyk.yykywd.util.GlideUtils

/**
 * 文件描述：
 * Created by guo on 2019-11-19.
 */
class ImageViewAdapter(private val context: Context,
                       layoutResId: Int,
                       data: MutableList<String>) : BaseQuickAdapter<String, BaseViewHolder>(layoutResId, data) {
    override fun convert(helper: BaseViewHolder, item: String) {
        val iv: ImageView = helper.getView(R.id.iv)

//        val params: ConstraintLayout.LayoutParams = iv.layoutParams as ConstraintLayout.LayoutParams
//        when (type) {
//            LICENCE -> {
//                params.dimensionRatio = "1"
//            }
//            ID_PHOTO -> {
//                params.dimensionRatio = "1.5"
//            }
//        }
//        iv.layoutParams = params

        GlideUtils.loadRoundCircleImage(context, HttpUrl.BASE_URL + item, iv, 4)
    }

}